<template>
	<div class="top">
		<div class="natice">
			<Notice :page="page" :noticeList="noticeList" :total="total" @change="showNotice"></Notice>
		</div>
	</div>
</template>

<script>
	import axios from 'axios'
	import Notice from './components/Notice.vue'
	export default {
		name: "ShowList",
		data() {
			return {
				noticeList: [],
				total: 12,
				page: 1
			}
		},
		mounted() {
			this.showNotice(1, 12);
		},
		methods: {
			showNotice(page, limit) {
				this.page = page;
				axios.get( this.$global_msg.userRoute + "/notice/showNotice", {
						params: {
							page: page,
							limit: limit
						}
					})
					.then(res => {
						this.noticeList = res.data.data
						this.total = res.data.count
					})
			}
		},
		components: {
			Notice
		}
	}
</script>

<style scoped>
	.top {
		height: 100%;
	}

	.natice {
		width: 850px;
		margin-top: 30px;
		margin-bottom: 30px;
		box-shadow: 0 0 10px #ddd;
		/* height: 500px; */
	}
</style>
